package com.teach.servlet.admin;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teach.entity.Lj;
import com.teach.service.LjService;
import com.teach.service.impl.LjServiceImpl;

//@WebServlet("/admin/lj-list.let")
public class LjListServlet extends HttpServlet{

	private LjService ljSeriver = new LjServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int len = 10;
		try {
			len = Integer.valueOf(request.getParameter("len"));
		}catch(Exception e) {
			
		}
				
		List<Lj> list = ljSeriver.list(len);
		request.setAttribute("list", list);
		request.getRequestDispatcher("/admin/lj-list.jsp").forward(request, response);
	}
}
